package com.demo.view;

import android.view.View;
import android.view.ViewGroup;

public class ViewAnimFactory {
    private View view;

    public ViewAnimFactory() {
        super();
    }

    public void setHeight(int height) {
        this.view.getLayoutParams().height = height;
        this.view.requestLayout();
    }
    public void setMarginTop(int marginTop){
        if (this.view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams){
            ViewGroup.MarginLayoutParams params  = (ViewGroup.MarginLayoutParams) this.view.getLayoutParams();
            params.topMargin = marginTop;
            this.view.setLayoutParams(params);
        }
        this.view.requestLayout();
    }

    public void setView(View view) {
        this.view = view;
    }
}
